'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc., All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH KICONV_CLOSE 9F "Oct 16, 2007"
.SH NAME
kiconv_close \- code conversion descriptor deallocation function
.SH SYNOPSIS
.nf
#include <sys/errno.h>
#include <sys/sunddi.h>



\fBint\fR \fBkiconv_close\fR(\fBkiconv_t\fR \fIcd\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI).
.SH PARAMETERS
.ne 2
.na
\fB\fIcd\fR\fR
.ad
.RS 6n
Code conversion descriptor to be deallocated.
.RE

.SH DESCRIPTION
The \fBkiconv_close()\fR function deallocates the conversion descriptor
\fIcd\fR and all other associated resources allocated by the
\fBkiconv_open()\fR function.
.SH RETURN VALUES
Upon successful completion, \fBkiconv_close()\fR returns 0; otherwise, it
returns the following \fIerrno\fR value to indicate the error:
.sp
.ne 2
.na
\fB\fBEBADF\fR\fR
.ad
.RS 9n
The code conversion descriptor is invalid.
.RE

.SH CONTEXT
\fBkiconv_close()\fR can be called from user or interrupt context.
.SH EXAMPLES
\fBExample 1 \fRClosing the Code Conversion
.sp
.LP
The following example shows how to close the code conversion descriptor with
error checking:

.sp
.in +2
.nf
if (kiconv_close(cd) == EBADF) {
         /* Code conversion descriptor is invalid. */
         return (-1);
}
.fi
.in -2

.sp
.LP
The following example shows how to close the code conversion descriptor without
error checking:

.sp
.in +2
.nf
(void) kiconv_close(cd);
.fi
.in -2

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.BR iconv (3C),
.BR iconv_close (3C),
.BR iconv_open (3C),
.BR u8_strcmp (3C),
.BR u8_textprep_str (3C),
.BR u8_validate (3C),
.BR uconv_u16tou32 (3C),
.BR uconv_u16tou8 (3C),
.BR uconv_u32tou16 (3C),
.BR uconv_u32tou8 (3C),
.BR uconv_u8tou16 (3C),
.BR uconv_u8tou32 (3C),
.BR attributes (7),
.BR kiconv (9F),
.BR kiconv_open (9F),
.BR kiconvstr (9F),
.BR u8_strcmp (9F),
.BR u8_textprep_str (9F),
.BR u8_validate (9F),
.BR uconv_u16tou32 (9F),
.BR uconv_u16tou8 (9F),
.BR uconv_u32tou16 (9F),
.BR uconv_u32tou8 (9F),
.BR uconv_u8tou16 (9F),
.BR uconv_u8tou32 (9F)
.sp
.LP
The Unicode Standard
.sp
.LP
http://www.unicode.org/standard/standard.html
